package oop.day03.HomeWork2;

public class Animal
{
    String name;
    int age;
    String color;
    Animal(String name,int age,String color)
    {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    void drink()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的动物在喝水");
    }

    void eat()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的动物在吃东西");
    }
}

interface Swim
{
    void swim();
}

class Dog extends Animal implements Swim
{
    Dog(String name,int age,String color)
    {
        super(name,age,color);
    }
    public void swim()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的动物在游泳");
    }
    void eat()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的狗子在吃东西");
    }
    void lookHome()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的狗子在看门");
    }
}


class Chick extends Animal
{
    Chick(String name,int age,String color)
    {
        super(name,age,color);
    }

    void eat()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的只因在吃东西");
    }
    void layEggs()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的只因在下蛋");
    }

}

class Fish extends Animal implements Swim
{
    Fish(String name ,int age ,String color)
    {
        super(name,age,color);
    }
    public void swim()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的🐟在游泳");
    }
    public void eat()
    {
        System.out.println("看 那有一个名叫" + name + " " + color + "色的" + age+ "岁的🐟在吃鱼食");
    }

}


